﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Approve.aspx.cs" Inherits="AttendanceWebForm_LeaveData_Approve" %>
<script runat="server">
    /* list */
    protected void gv_DataBinding(object sender, EventArgs e)
    {
        var db = new DB("Attendance");
        var dt = db.Execute(string.Format(@"SELECT ld.* FROM LeaveData ld WHERE ld.OrgID IN ({0})
                    AND Status = '1' "
            , MyObj.JoinFormat(",", "'{0}'", RoleManager.Current.GetOrgForCurrentComp())));

        (sender as DataBoundControl).DataSource = dt;
    }
    /* end of list */

    /* form */

    /* end of form */
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <My:MyGridView ID="gv" runat="server" OnDataBinding="gv_DataBinding" OnRowCommand="gv_ItemCommand"
        DataKeyNames="LeaveID">
        <Columns>
            <asp:TemplateField HeaderText="<%$Resources: LeaveData, EmpID   %>">
                <ItemTemplate>
                    <%#Eval("EmpID") %>
                    <%# LocManager.Current.GetText("EmpData", "EmpName", Eval("EmpID"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: LeaveData, OrgID   %>">
                <ItemTemplate>
                    <%# LocManager.Current.GetText("OrgData", "OrgName", Eval("OrgID")) %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: LeaveData, LeaveType   %>">
                <ItemTemplate>
                    <%# CodeManager.Current.GetText("LeaveData", "LeaveType", Eval("LeaveType"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: LeaveData, LeaveStartDate   %>">
                <ItemTemplate>
                    <%#Eval("LeaveStartDate", "{0:yyyy/MM/dd HH:mm}")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: LeaveData, LeaveEndDate   %>">
                <ItemTemplate>
                    <%#Eval("LeaveEndDate", "{0:yyyy/MM/dd HH:mm}")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: LeaveData, Hours   %>">
                <ItemTemplate>
                    <%#Eval("Hours")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: Form, CreateDate   %>">
                <ItemTemplate>
                    <%#Eval("CreateDate")%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: Form, Status   %>">
                <ItemTemplate>
                    <%# CodeManager.Current.GetText("LeaveData", "Status", Eval("Status"))%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="<%$Resources: Form, btnApprove %>">
                <ItemTemplate>
                    <asp:Button ID="btnAgree" runat="server" CommandName="MyAgree" Text="<%$Resources: Form, btnAgree %>"></asp:Button>
                    <ajax:ConfirmButtonExtender ID="cbAgree" runat="server" TargetControlID="btnAgree"
                        ConfirmText="<%$Resources: Form, cb %>">
                    </ajax:ConfirmButtonExtender>
                    <asp:Button ID="btnReject" runat="server" CommandName="MyReject" Text="<%$Resources: Form, btnReject %>"></asp:Button>
                    <ajax:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="btnReject"
                        ConfirmText="<%$Resources: Form, cb %>">
                    </ajax:ConfirmButtonExtender>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </My:MyGridView>
</asp:Content>

